﻿using Behavioral;

namespace Calculator.MSTest
{
    public class CalculatorIsDefaultConstructed : IInitializer<Calculator>
    {
        public void SetUp(ref Calculator calculator)
        {
            calculator = new Calculator();

            this.SetContext(int.MaxValue);
            this.SetContext("one", 1);
            this.SetContext("two", 2);
            this.SetContext("three", 3);
        }
    }

    public class NoopInitializerWithoutContext : IInitializer
    {
        public void SetUp()
        {
            
        }
    }

    public class EditingInitializerWithContext : IInitializer<int>
    {
        public void SetUp(ref int value)
        {
            value = int.MinValue;
        }
    }

    public class NoopInitializerWithContext : IInitializer<int>
    {
        public void SetUp(ref int value)
        {
            
        }
    }

    public class NoopInitializerWithWrongContext : IInitializer<string>
    {
        public void SetUp(ref string value)
        {

        }
    }

    public class CalculatorIsReadyToRun : InitializerCollection
    {
        protected override void Register()
        {
            GivenThat<CalculatorIsDefaultConstructed>()
                .And<NoopInitializerWithoutContext>()
                .And<EditingInitializerWithContext>()
                .And<NoopInitializerWithContext>()
                .And<NoopInitializerWithWrongContext>();
        }
    }
}
